package tg.webclient.rj.beans.doclinks;

import java.rmi.RemoteException;
import psdi.util.MXException;
import psdi.webclient.beans.doclinks.AddDocLinksBean;
import psdi.webclient.system.controller.WebClientEvent;
import psdi.webclient.system.session.WebClientSession;

public class CustAddDocLinksBean extends AddDocLinksBean
{
  String doctype;

  public CustAddDocLinksBean()
  {
    this.doctype = "";
  }

  public void setupBean(WebClientSession sc) {
    super.setupBean(sc);
    this.doctype = this.creatingEvent.getValueString();
  }

  public synchronized void insert() throws MXException, RemoteException {
    super.insert();
    if ((!this.doctype.equalsIgnoreCase("")) && 
      (!this.doctype.equalsIgnoreCase("default")))
      setValue("doctype", this.doctype);
  }

  public int execute() throws MXException, RemoteException
  {
    return super.execute();
  }
}